package cn.com.nthotline.fragment;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;
import cn.com.nthotline.R;
import cn.com.nthotline.fragment.ActionBarConfigurar.ActionBarConfigurarFactory;
import cn.com.nthotline.model.UserNotice;
import cn.com.nthotline.util.CommonUtil;

public class FragmentNoticeDetail extends Fragment implements
		ActionBarConfigurarFactory {
	private UserNotice notice;
	private TextView tvDate,tvContent;
	@Override
	public ActionBarConfigurar getActionBarConfigurar() {
		// TODO Auto-generated method stub
		return new ActionBarConfigurar() {

			@Override
			public String getTitle() {
				return "֪ͨ";
			}

			@Override
			public boolean showCancelButton() {
				// TODO Auto-generated method stub
				return false;
			}

			@Override
			public String customTitle() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public boolean showBackButton() {
				return true;
			}

			@Override
			public String showRightButton() {
				// TODO Auto-generated method stub
				return null;
			}

			@Override
			public boolean showRightSearch() {
				// TODO Auto-generated method stub
				return false;
			}
		};
	}
	@Override
	public void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		notice=(UserNotice)getArguments().getSerializable("notice");
	}
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		View view=inflater.inflate(R.layout.fragment_notice_detal,container, false);
		tvDate=(TextView)view.findViewById(R.id.tvDate);
		tvContent=(TextView)view.findViewById(R.id.tvContent);
		tvDate.setText(CommonUtil.formatDate1(notice.time));
		tvContent.setText(CommonUtil.filterHtmlNotice(notice.content));
		return view;
	}
	
}
